package de.westranger.forex.trading.genetic.allel.operator;

import java.text.ParseException;

public enum CompareOperatorType {
	LESS(0), LARGER(1), /*LESSEQUAL(2), LARGEREQUAL(3), EQUALS(4),*/DO_NOT_USE_ME(666);

	private final int value;

	private CompareOperatorType(final int value) {
		this.value = value;
	}

	public final int getValue() {
		return this.value;
	}
	
	public static final CompareOperatorType parse(final int value) throws ParseException {
		CompareOperatorType termSym;
		switch (value) {
		case 0:
			termSym = CompareOperatorType.LESS;
			break;
		case 1:
			termSym = CompareOperatorType.LARGER;
			break;
		case 666:
			termSym = CompareOperatorType.DO_NOT_USE_ME;
			break;
		default:
			throw new ParseException(
					"could not parse CompareOperatorType with the value " + value, 0);
		}
		return termSym;
	}
	
}
